﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data;
using ET;
namespace DA
{
    public class Order_Buy_Detail_DAL : clsConnect
    {
        private clsConnect cls = new clsConnect();
        public bool InsertOrderDetail(ET_Order_Buy_Detail data)
        {
            cls.CreateNewSqlCommand();
            cls.AddParameter("@Order_Buy_Id", data.Order_Buy_Id);
            cls.AddParameter("@Materials_Id", data.Materials_Id);
            cls.AddParameter("@Order_Detail_Quality", data.Order_Detail_Quality);
            cls.AddParameter("@Order_Detail_Price", data.Order_Detail_Price);

            cls.AddParameter("@Order_Detail_CK_Percent", data.Order_Detail_CK_Percent);
            cls.AddParameter("@Order_Detail_CK", data.Order_Detail_CK);

            cls.AddParameter("@Order_Detail_VAT_Percent", data.Order_Detail_VAT_Percent);
            cls.AddParameter("@Order_Detail_VAT", data.Order_Detail_VAT);

            cls.AddParameter("@Order_Detail_Total_Price", data.Order_Detail_Total_Price);
            cls.AddParameter("@IsActive", data.IsActive);
            cls.ExecuteNonQuery("sp_tb_tb_Order_Buy_Detail_Insert");
            return true;
        }
        public bool DeleteOrderDetail(int id)
        {
            cls.Delete("sp_tb_Order_Del", "@Order_Id", id);
            return true;
        }
    }
}
